/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Utilitarios;

import javax.swing.InputVerifier;

import javax.swing.JComponent;

import javax.swing.JOptionPane;

import javax.swing.JTextField;





public class Verificador extends InputVerifier {



	@Override

	public boolean verify(JComponent editor) {
                // suponemos que JComponent será un JTextField

		if (editor instanceof JTextField)

		{

			String texto = ((JTextField)editor).getText();

			if(texto.compareTo("")==0){
                                JOptionPane.showMessageDialog(editor, "Digite el texto");
				return false;

			}

			else

			{
                              
				
				return true;

			}
                        

		}
                return false;
        }
}
